<?php

/**
 * Tema form base class.
 *
 * @package    form
 * @subpackage tema
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseTemaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cd_tema'     => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInput(),
      'cd_tema_pai' => new sfWidgetFormDoctrineChoice(array('model' => 'Tema', 'add_empty' => true)),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
      'deleted'     => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'cd_tema'     => new sfValidatorDoctrineChoice(array('model' => 'Tema', 'column' => 'cd_tema', 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 50)),
      'cd_tema_pai' => new sfValidatorDoctrineChoice(array('model' => 'Tema', 'required' => false)),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
      'deleted'     => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('tema[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Tema';
  }

}
